<!--
 * Copyright TLR Team, Inc. All Rights Reserved.
-->
<ng-include src="'app/mvp/template/view/form/rename.html'"></ng-include>
<div class="eban-bg">
    <div class="container-fluid">
        <!-- /.row -->
        <div class="row">
            <div class="device-item-title item-font title-bg">
                <div class="device-title-txt">健康精灵</div>
                <div class="right-triangle"></div>
                <div style="float:right;" class="device-title-txt"><a href="#/eban-bind">绑定</a></div>
            </div>
        </div>
        <div clas="row" ng-if="!healthDevices">
            <div class="loading">
                <span></span>
                <span></span>
                <span></span>
                <span></span>
                <span></span>
            </div>
        </div>
        <div class="row" ng-if="healthDevices.length === 0">
            <div class="col-sm-12 device-item-container">
                <div class="device-item background">
                    <div class="device-item-txt" style="padding-top:20px;text-align:center;">
                        无绑定设备
                    </div>
                </div>
            </div>
        </div>
        <div class="row" ng-repeat="device in healthDevices track by $index">
            <div class="col-sm-12 device-item-container">
                <div class="device-item background" ng-class="{'device-item-active': healthDeviceIndex === $index}" style="font-size:22px;">
                    <div ng-long-press="onLongPress" ng-long-press-index="{{$index}}" class="device-item-alias eban-title">
                        <span class="item-font">{{device.nick_name}}</span><br>
                        <span class="item-font item-small-font">长按3秒修改</span>
                    </div>
                    <div ng-click="deviceClick($index);" class="row device-item-txt" style="text-align:center;">
                        <div class="col-xs-12">
                            <span class="tlr-icon2-eban-cur-stat" style="font-size:12px;">最新健康分数</span>
                            <span style="font-size:45px;"ng-if="device.point && device.point !== ''">{{device.point}}</span>
                            <span style="font-size:45px;" ng-if="device.point === '' || !device.point">0</span>
                        </div>
                    </div>
                    <div ng-click="deviceClick($index);" class="row device-item-location item-font">
                        <i class="tlr-icon2-position"></i>
                        <span ng-if="device.position && device.position !== ''">{{device.position}}</span>
                        <span ng-if="!device.position || device.position === ''">位置未知</span>
                    </div>
                    <div id="health-device-menu-id-{{$index}}" class="tlr-menu-container" style="display:none;height:220px;">
                        <div class="col-xs-12 device-menu-item">
                            <a href="#/eban-current?storage_id={{device.storage_id}}">
                                <div class="tlr-menu-item2">
                                    <div class="tlr-icon2-day"></div><span class="item-font">当日活动</span>
                                </div>
                            </a>
                        </div>
                        <div class="col-xs-12 tlr-menu-bottom-border"></div>
                        <div class="col-xs-12 device-menu-item">
                            <a href="#/eban-history?storage_id={{device.storage_id}}">
                                <div class="tlr-menu-item2">
                                    <div class="tlr-icon2-history"></div><span class="item-font">历史统计</span>
                                </div>
                            </a>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <!-- /.row -->
    </div>
</div>